unit DMClient;

interface

uses
  System.SysUtils, System.Classes, kbmMWClient, kbmMWCustomConnectionPool,
  kbmMWClientDataset, kbmMemTable, kbmMWStreamFormat, kbmMWBinaryStreamFormat,
  kbmMWSecurity, kbmMWDCP2Crypt, kbmMWCustomTransport,
  kbmMWTCPIPIndyClientTransport, kbmMWTCPIPSynapseClientTransport;

type
  TdtmdlClientLink = class(TDataModule)
    kbmwpldsnLink: TkbmMWPooledSession;
    kbmMWDCP2Crypt1: TkbmMWDCP2Crypt;
    kbmwbnrystrmfrmtLink: TkbmMWBinaryStreamFormat;
    kbmccplLink: TkbmMWClientConnectionPool;
    kbmscLink: TkbmMWSimpleClient;
    kbmwtcpsynpsclntrnsprtLink: TkbmMWTCPIPSynapseClientTransport;
    procedure DataModuleCreate(Sender: TObject);
  private
    procedure InitializeComponent();
  public
    { Public declarations }
  end;

var
  dtmdlClientLink: TdtmdlClientLink;

implementation

{ %CLASSGROUP 'System.Classes.TPersistent' }

{$R *.dfm}

uses kbmMWGlobal, kbmMWZipStdTransStream;

procedure TdtmdlClientLink.DataModuleCreate(Sender: TObject);
begin
  InitializeComponent;
end;

procedure TdtmdlClientLink.InitializeComponent;
begin
  // with kbmwtcpndyclntrnsprtLink do
  // begin
  // Crypt:=kbmMWDCP2Crypt1;
  // Host:='127.0.0.1';
  // //Host:='172.19.100.107';
  // Port:=12582;
  // RequestTimeout:=30;
  // StreamFormat:='ZIPPED';
  // StringConversion:=mwscFixed;
  // MaxRetries:=2;
  // end;

  with kbmwtcpsynpsclntrnsprtLink do
  begin
    Crypt := kbmMWDCP2Crypt1;
    Host := '127.0.0.1';
    // Host:='172.19.100.107';
    Port := '12582';
    ConnectTimeout := 30;
    StreamFormat := 'ZIPPED';
    StringConversion := mwscFixed;
    MaxRetries := 2;
  end;

  with kbmscLink do
  begin
    Password := 'xalion@#123456';
    Username := 'xalion';
    Transport := kbmwtcpsynpsclntrnsprtLink;
  end;

  with kbmccplLink do
  begin
    Transport := kbmwtcpsynpsclntrnsprtLink;
  end;

  with kbmwpldsnLink do
  begin
    ConnectionPool := kbmccplLink;
    SessionName := 'demo';
  end;
end;

end.
